home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc / OpenDoc Development / Debugging Support / OpenDoc™ Source Code / Binding / NoPart.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-08-28  |  32.8 KB  |  1,205 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        NoPart.cpp
  3.  
  4.     Contains:    Implementation of class NoPart
  5.  
  6.     Owned by:    Reginald Adkins
  7.  
  8.     Copyright:    © 1992 - 1996 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     Change History (most recent first):
  11.  
  12.          <7>     7/30/96    eeh        1372943: test for kTranslateItem
  13.          <5>     7/17/96    jpa        1369044: Dispose pixpat in Draw method to
  14.                                     avoid a memory leak.
  15.          <4>     7/11/96    jpa        1364071: Glitch in message if editor name
  16.                                     is non-NULL but empty.
  17.          <3>     6/27/96    jpa        1361886: Kinder, gentler NoPart (display
  18.                                     message to user.) 1361916: Don't force
  19.                                     process to quit in Open method.
  20.          <2>     6/22/96    EL        1344140: in NoPartOpen, do not rebind if it
  21.                                     is root and do not call translation dialog.
  22.  
  23.     In Progress:
  24.         
  25. */
  26.  
  27. #ifndef _PLFMDEF_
  28. #include <PlfmDef.h>
  29. #endif
  30.  
  31. #ifndef _ALTPOINT_
  32. #include <AltPoint.h>            // Use C++ savvy XMPPoint and XMPRect
  33. #endif
  34.  
  35. #ifndef _INFOUTIL_
  36. #include <InfoUtil.h>
  37. #endif
  38.  
  39. #ifndef _TEMPOBJ_
  40. #include <TempObj.h>
  41. #endif
  42.  
  43. #ifndef SOM_NoPart_xh
  44. #include <NoPart.xh>
  45. #endif
  46.  
  47. #ifndef SOM_ODFrame_xh
  48. #include <Frame.xh>
  49. #endif
  50.  
  51. #ifndef SOM_ODFacet_xh
  52. #include <Facet.xh>
  53. #endif
  54.  
  55. #ifndef SOM_ODShape_xh
  56. #include <Shape.xh>
  57. #endif
  58.  
  59. #ifndef SOM_ODTransform_xh
  60. #include <Trnsform.xh>
  61. #endif
  62.  
  63. #ifndef SOM_ODWindow_xh
  64. #include <Window.xh>
  65. #endif
  66.  
  67. #ifndef SOM_ODInfo_xh
  68. #include <Info.xh>
  69. #endif
  70.  
  71. #ifndef SOM_ODFrameFacetIterator_xh
  72. #include "FrFaItr.xh"
  73. #endif
  74.  
  75. #ifndef SOM_ODStorageUnit_xh
  76. #include <StorageU.xh>
  77. #endif
  78.  
  79. #ifndef SOM_ODContainer_xh
  80. #include <ODCtr.xh>
  81. #endif
  82.  
  83. #ifndef SOM_ODSession_xh
  84. #include <ODSessn.xh>
  85. #endif
  86.  
  87. #ifndef SOM_ODDispatcher_xh
  88. #include <Disptch.xh>
  89. #endif
  90.  
  91. #ifndef SOM_ODTranslation_xh
  92. #include <Translt.xh>
  93. #endif
  94.  
  95. #ifndef SOM_ODWindowState_xh
  96. #include <WinStat.xh>
  97. #endif
  98.  
  99. #ifndef _BNDNGDEF_
  100. #include <BndngDef.h>
  101. #endif
  102.  
  103. #ifndef _SHELLDEF_
  104. #include <ShellDef.h>    /* I use RealShell's error messages (from ErrMsgs.r) */
  105. #endif
  106.  
  107. #ifndef _DLOGUTIL_
  108. #include <DlogUtil.h>
  109. #endif
  110.  
  111. #ifndef _DOCUTILS_
  112. #include <DocUtils.h>
  113. #endif
  114.  
  115. #ifndef _FOCUSLIB_
  116. #include <FocusLib.h>
  117. #endif
  118.  
  119. #ifndef _PASCLSTR_
  120. #include <PasclStr.h>
  121. #endif
  122.  
  123. #ifndef _USERSRCM_
  124. #include <UseRsrcM.h>
  125. #endif
  126.  
  127. #ifndef SOM_ODPartWrapper_xh
  128. #include <PartWrap.xh>
  129. #endif
  130.  
  131. #ifndef _BINDNGH_
  132. #include <BindngH.h>
  133. #endif
  134.  
  135. #ifndef SOM_ODBinding_xh
  136. #include <ODBindng.xh>
  137. #endif
  138.  
  139. #ifndef _BNDNGDEF_
  140. #include <BndngDef.h>
  141. #endif
  142.  
  143. #ifndef _ISOSTR_
  144. #include <ISOStr.h>
  145. #endif
  146.  
  147. #ifndef __ICONS__
  148. #include <Icons.h>
  149. #endif
  150.  
  151. #ifndef __QUICKDRAW__
  152. #include <Quickdraw.h>
  153. #endif
  154.  
  155. #ifndef __RESOURCES__
  156. #include <Resources.h>
  157. #endif
  158.  
  159. #ifndef __DIALOGS__
  160. #include <Dialogs.h>
  161. #endif
  162.  
  163. #ifndef __TEXTUTILS__
  164. #include <TextUtils.h>
  165. #endif
  166.  
  167. #ifndef __TOOLUTILS__
  168. #include <ToolUtils.h>
  169. #endif
  170.  
  171. #ifndef SOM_ODStorageSystem_xh
  172. #include <ODStor.xh>
  173. #endif
  174.  
  175. #ifndef _TRANSUTL_
  176. #include <TransUtl.h>
  177. #endif
  178.  
  179. #ifndef _BNDNSUTL_
  180. #include <BndNSUtl.h>
  181. #endif
  182.  
  183.  
  184. #pragma segment NoPart
  185.  
  186. #define SOM_Module_nopart_Source
  187. #define VARIABLE_MACROS
  188. #include <NoPart.xih>
  189.  
  190.  
  191. //==============================================================================
  192. // Constants
  193. //==============================================================================
  194.  
  195.  
  196. const short kButtonWidth  = 26;            // Dimensions of button
  197. const short kButtonHeight = 22;
  198.  
  199. const short kButtonPrefTop = 38;        // Preferred position relative to frame top/left
  200. const short kButtonPrefLeft=  0;
  201.  
  202. const short kButtonAltTop  =  0;        // Alternate position if frame too short
  203. const short kButtonAltLeft = 38;
  204.  
  205. const short kMinTextWidth = 48;            // Min dimensions of usable text box
  206. const short kMinTextHeight= 12;
  207.  
  208. const ODError    kFakeErrNoEditorNoName    = -1;
  209. const ODError    kFakeErrNoEditor        = -2;
  210.  
  211. const short kTranslateItem    = 2;        // "Translate..." button in alert
  212. const short kErrorNumberItem= 4;
  213.     
  214.  
  215. //==============================================================================
  216. // Variables
  217. //==============================================================================
  218.  
  219.  
  220. static ODIconFamily gButtonIcon = kODNULL;
  221.  
  222.  
  223. //==============================================================================
  224. // Local Functions
  225. //==============================================================================
  226.  
  227.  
  228. static void    TransparentTextBox( void *text, short length, const Rect &box);
  229.  
  230.  
  231. static inline short Width ( const Rect &r )    {return r.right-r.left;}
  232. static inline short Height( const Rect &r )    {return r.bottom-r.top;}
  233.  
  234.  
  235.  
  236. //==============================================================================
  237. // NoPart
  238. //==============================================================================
  239.  
  240.  
  241. //--------------------------------------------------------------------
  242. // somUninit
  243. //--------------------------------------------------------------------
  244.  
  245. SOM_Scope void  SOMLINK NoPartsomUninit(Apple_NoPart *somSelf)
  246. {
  247.     Apple_NoPartData *somThis = Apple_NoPartGetData(somSelf);
  248.     Apple_NoPartMethodDebug("Apple_NoPart","somUninit");
  249.  
  250.     DisposeIText(_fUserMessageEditorName);
  251.     delete _fUserMessageParam;
  252. }
  253.  
  254.  
  255. //--------------------------------------------------------------------
  256. // Release
  257. //--------------------------------------------------------------------
  258.  
  259. SOM_Scope void  SOMLINK NoPartRelease(Apple_NoPart *somSelf, Environment *ev)
  260. {
  261.     Apple_NoPartData *somThis = Apple_NoPartGetData(somSelf);
  262.     Apple_NoPartMethodDebug("Apple_NoPart","Release");
  263.     
  264.     SOM_TRY
  265.  
  266.     parent_Release(somSelf, ev);
  267.     if (somSelf->GetRefCount(ev) == 0)
  268.         _fStorageUnit->GetDraft(ev)->ReleasePart(ev, (ODPart*)_fPartWrapper);
  269.     
  270.     SOM_CATCH_ALL
  271.     SOM_ENDTRY
  272. }
  273.  
  274.  
  275. //--------------------------------------------------------------------
  276. // InitPart
  277. //--------------------------------------------------------------------
  278.  
  279. SOM_Scope void  SOMLINK NoPartInitPart(Apple_NoPart *somSelf, Environment *ev,
  280.         ODStorageUnit* storageUnit, ODPart* partWrapper)
  281. {
  282.     Apple_NoPartData *somThis = Apple_NoPartGetData(somSelf);
  283.     Apple_NoPartMethodDebug("Apple_NoPart","InitPart");
  284.     
  285.     SOM_TRY
  286.  
  287.     parent_InitPart(somSelf, ev, storageUnit, partWrapper);
  288.     
  289.     _fStorageUnit = storageUnit;
  290.     _fPartWrapper = (ODPartWrapper*)partWrapper;
  291.     _fSession = storageUnit->GetSession(ev);
  292.     
  293.     SOM_CATCH_ALL
  294.     SOM_ENDTRY
  295. }
  296.  
  297.  
  298. //--------------------------------------------------------------------
  299. // InitPartFromStorage
  300. //--------------------------------------------------------------------
  301.  
  302. SOM_Scope void  SOMLINK NoPartInitPartFromStorage(Apple_NoPart *somSelf, Environment *ev,
  303.         ODStorageUnit* storageUnit, ODPart* partWrapper)
  304. {
  305.     Apple_NoPartData *somThis = Apple_NoPartGetData(somSelf);
  306.     Apple_NoPartMethodDebug("Apple_NoPart","InitPartFromStorage");
  307.     
  308.     SOM_TRY
  309.  
  310.     parent_InitPartFromStorage(somSelf, ev, storageUnit, partWrapper);
  311.     
  312.     _fStorageUnit = storageUnit;
  313.     _fPartWrapper = (ODPartWrapper*)partWrapper;
  314.     _fSession = storageUnit->GetSession(ev);
  315.     
  316.     SOM_CATCH_ALL
  317.     SOM_ENDTRY
  318. }
  319.  
  320.  
  321. //--------------------------------------------------------------------
  322. // SetUserMessage
  323. //--------------------------------------------------------------------
  324.  
  325. SOM_Scope void SOMLINK NoPartSetUserMessage( Apple_NoPart *somSelf, Environment *ev,
  326.         ODError err,
  327.         ODIText *editorName,
  328.         corbastring param )
  329. {
  330.     Apple_NoPartData *somThis = Apple_NoPartGetData(somSelf);
  331.     Apple_NoPartMethodDebug("Apple_NoPart","SetUserMessage");
  332.     
  333.     SOM_TRY
  334.     
  335.     if( editorName && GetITextStringLength(editorName)==0 ) {
  336.         DisposeIText(editorName);
  337.         editorName = kODNULL;
  338.     }
  339.     
  340.     if( err == 0 )
  341.         err = editorName ?kFakeErrNoEditor :kFakeErrNoEditorNoName;
  342.     _fUserMessageID = err;
  343.     _fUserMessageEditorName = editorName;
  344.     if( param )
  345.         _fUserMessageParam = ODISOStrFromCStr(param);
  346.     
  347.     SOM_CATCH_ALL
  348.     SOM_ENDTRY
  349. }
  350.  
  351.  
  352. //--------------------------------------------------------------------
  353. // ComputeButtonLocation
  354. //--------------------------------------------------------------------
  355.  
  356. SOM_Scope void SOMLINK NoPartComputeButtonLocation( Apple_NoPart *somSelf, Environment *ev,
  357.         ODFrame *frame,
  358.         Rect *loc,
  359.         Rect *textBox )
  360. {
  361.     Apple_NoPartData *somThis = Apple_NoPartGetData(somSelf);
  362.     Apple_NoPartMethodDebug("Apple_NoPart","ComputeButtonLocation");
  363.     
  364.     // Load icon now since caller will presumably need it:
  365.     if( !gButtonIcon ) {
  366.         CUsingLibraryResources r;
  367.         OSErr err= GetIconSuite(&gButtonIcon,kNoPartButtonIconResID,kSelectorAllAvailableData);
  368.         WASSERTM(err==noErr||err==memFullErr,"Can't get NoPart button");
  369.     }
  370.  
  371.     TempODShape usedShape = frame->AcquireUsedShape(ev,kODNULL);
  372.     Rect used = (**(usedShape->GetQDRegion(ev))).rgnBBox;
  373.     InsetRect(&used,3,3); // allow for border
  374.     
  375.     // Preferentially put the button below the icon.
  376.     // If the frame isn't tall enough, put it to the right.
  377.     // If it's not even wide enough, put it at the bottom right.
  378.     
  379.     loc->left = used.left;
  380.     loc->top  = used.top;
  381.     if( kButtonPrefTop + kButtonHeight <= Height(used) ) {
  382.         loc->left += kButtonPrefLeft;
  383.         loc->top  += kButtonPrefTop;
  384.     } else if( kButtonAltLeft + kButtonWidth <= Width(used) ) {
  385.         loc->left += kButtonAltLeft;
  386.         loc->top  += kButtonAltTop;
  387.     } else {
  388.         loc->left = used.right-kButtonWidth;
  389.         loc->top  = used.bottom-kButtonHeight;
  390.     }
  391.     
  392.     textBox->left = loc->left + kButtonWidth + 2;    // Put text to right of button
  393.     textBox->top  = loc->top - 2;
  394.     if( used.right-textBox->left < kMinTextWidth ) {
  395.         textBox->left -= kButtonWidth+2;            // ...but if no room move it below
  396.         textBox->top  += kButtonHeight+4;
  397.     }
  398.     
  399.     textBox->right = used.right;
  400.     textBox->bottom= used.bottom;
  401.     
  402.     loc->right = loc->left + 32;                    // Icon utils want exact 32x32 rect
  403.     loc->bottom= loc->top  + 32;
  404.     
  405.     if( Width(*textBox) < kMinTextWidth || Height(*textBox)< kMinTextHeight)
  406.         textBox->bottom=textBox->top;                // Force empty if it's too small
  407. }
  408.  
  409.  
  410. static void
  411. Substitute( Handle text, Str255 replacement, int which )
  412. {
  413.     unsigned char whichStr[3] = "\p^0";
  414.     whichStr[2] = '0'+which;
  415.     Handle replaceH;
  416.     THROW_IF_ERROR( PtrToHand(&replacement[1],&replaceH,replacement[0]) );
  417.     ReplaceText(text,replaceH,whichStr);
  418.     DisposeHandle(replaceH);
  419. }
  420.  
  421.  
  422. //--------------------------------------------------------------------
  423. // ComputeUserMessage
  424. //--------------------------------------------------------------------
  425.  
  426. SOM_Scope ODIText SOMLINK NoPartComputeUserMessage( Apple_NoPart *somSelf, Environment *ev )
  427. {
  428.     Apple_NoPartData *somThis = Apple_NoPartGetData(somSelf);
  429.     Apple_NoPartMethodDebug("Apple_NoPart","ComputeUserMessage");
  430.     
  431.     Str255 messageStr;
  432.     ODBoolean noSpecific = kODFalse;
  433.     if( ! LookupString(_fUserMessageID,kNoPartMessageTableID,messageStr) ) {
  434.         // No specific message. Get generic message & remember to lookup Shell msg later:
  435.         CUsingLibraryResources r;
  436.         GetIndString(messageStr,kNoPartMessageTableID,1);
  437.         noSpecific = kODTrue;
  438.     }
  439.     
  440.     Handle messageH = kODNULL;
  441.     THROW_IF_ERROR( PtrToHand(&messageStr[1],&messageH,messageStr[0]) );
  442.     TempODHandle tempMessageH = messageH; // ensure deletion
  443.     
  444.     Str255 editor;
  445.     if( _fUserMessageEditorName )
  446.         GetITextPString(_fUserMessageEditorName,editor);
  447.     else
  448.         editor[0] = '\0';
  449.  
  450.     Str255 param;
  451.     if( noSpecific )
  452.         LookupString(_fUserMessageID,kODErrUserID,param);    // Get Shell's message as param
  453.     else                                                    // (requires access to Shell rsrcs!)
  454.         CopyISOStr2PStr(param,_fUserMessageParam);
  455.     
  456.  
  457.     Str31 errStr;
  458.     NumToString(_fUserMessageID,errStr);
  459.  
  460.     Substitute(messageH, editor, 1);
  461.     Substitute(messageH, param,  2);
  462.     Substitute(messageH, errStr, 3);
  463.  
  464.     ODIText itext;
  465.     InitIText(&itext);
  466.     HLock(messageH);
  467.     SetITextText(&itext, (ODUByte*)*messageH, GetHandleSize(messageH));
  468.     return itext;
  469. }
  470.  
  471.  
  472. //--------------------------------------------------------------------
  473. // Draw
  474. //--------------------------------------------------------------------
  475.  
  476. SOM_Scope void  SOMLINK NoPartDraw(Apple_NoPart *somSelf, Environment *ev,
  477.         ODFacet* facet, ODShape* invalidShape)
  478. {
  479.     Apple_NoPartData *somThis = Apple_NoPartGetData(somSelf);
  480.     Apple_NoPartMethodDebug("Apple_NoPart","Draw");
  481.  
  482. ODUnused(invalidShape);
  483.     
  484.     SOM_TRY
  485.  
  486.     ODFrame*    frame = facet->GetFrame(ev);
  487.     ODTypeToken view = frame->GetViewType(ev);
  488.     
  489.     IconTransformType     transformType = ttNone;
  490.     ODWindow*    window = facet->GetWindow(ev);
  491.  
  492.     // Check to see if the frame is selected and in an active window
  493. //    if ( facet->GetHighlight(ev) == kODFullHighlight &&
  494. //         window->IsActive(ev) )
  495. //        transformType = ttSelected;
  496.  
  497.     Rect iconRect;
  498.     if (view == _fSession->Tokenize(ev, kODViewAsSmallIcon))
  499.         SetRect(&iconRect, 0, 0, 16, 16);
  500.     else
  501.         SetRect(&iconRect, 0, 0, 32, 32);
  502.  
  503.     // Init the icon family if necessary
  504.     if (_fIconFamily == kODNULL)
  505.         _fIconFamily = ODGetIconFamily(ev, frame);
  506.     
  507.     TempODShape usedShape = frame->AcquireUsedShape(ev, kODNULL);
  508.     RgnHandle usedRgn = usedShape->GetQDRegion(ev);
  509.  
  510.     // Now it's time to draw:
  511.     CFocus foc(ev,facet);
  512.     EraseRgn(usedRgn);
  513.     
  514.     if ( view == _fSession->Tokenize(ev, kODViewAsLargeIcon) || 
  515.                     view == _fSession->Tokenize(ev, kODViewAsSmallIcon) )
  516.     {            
  517.     }
  518.     else if ( view == _fSession->Tokenize(ev, kODViewAsThumbnail) )
  519.     {
  520.         CUsingLibraryResources res;
  521.         Handle thumbnail = (Handle) GetPicture(kNoPartThumbnail);
  522.     
  523.         if ( thumbnail == kODNULL ) {
  524.             THROW_IF_ERROR((ODError)ResError());
  525.             THROW(resNotFound);
  526.         }
  527.  
  528.         Rect bounds = (**(PicHandle) thumbnail).picFrame;
  529.         OffsetRect(&bounds, -bounds.left, -bounds.top);
  530.         DrawPicture((PicHandle) thumbnail, &bounds);
  531.         ReleaseResource(thumbnail);
  532.     }
  533.     else // if ( view == _fSession->Tokenize(ev, kODViewAsFrame) )
  534.     {
  535.         RGBColor rgb = {32768,32768,32768};
  536.         PixPatHandle ppat = NewPixPat();
  537.         MakeRGBPat(ppat, &rgb);
  538.         BackPixPat(ppat);
  539.  
  540.         EraseRgn(usedRgn);
  541.         FrameRgn(usedRgn);
  542.         
  543.         // Draw button & message, if any
  544.         {
  545.             Rect rButton, rText;
  546.             somSelf->ComputeButtonLocation(ev, frame, &rButton, &rText);
  547.             if( gButtonIcon )
  548.                 PlotIconSuite(&rButton, atTopLeft, ttNone, gButtonIcon);
  549.             
  550.             if( !EmptyRect(&rText) ) {
  551.                 ODIText text = somSelf->ComputeUserMessage(ev);
  552.                 short savedFont = qd.thePort->txFont;
  553.                 short savedSize = qd.thePort->txSize;
  554.                 long fontsize = GetScriptVariable(GetITextScriptCode(&text),
  555.                                                   smScriptSmallFondSize);
  556.                 TextFont( fontsize >> 16 );
  557.                 TextSize( fontsize & 0xFFFF );
  558.                 TextFace(0);
  559.                 
  560.                 FontInfo i;
  561.                 GetFontInfo(&i);
  562.                 rText.bottom -= Height(rText) % (i.ascent+i.descent+i.leading); // no partial lines
  563.                 
  564.                 TETextBox( GetITextPtr(&text), GetITextStringLength(&text), &rText, teFlushDefault );
  565.  
  566.                 TextFont(savedFont);
  567.                 TextSize(savedSize);
  568.                 DisposeITextStruct(text);
  569.             }
  570.         }
  571.         
  572.         BackPat(&qd.white);
  573.         DisposePixPat(ppat);    // According to IM, QD will dispose it, but IM is wrong...
  574.         
  575.         OffsetRect(&iconRect,2,2);        // Position icon away from border
  576.     }
  577.     
  578.     // Finally draw the part icon:
  579.     PlotIconSuite(&iconRect, atTopLeft, transformType, _fIconFamily);
  580.  
  581.     SOM_CATCH_ALL
  582.     SOM_ENDTRY
  583. }
  584.  
  585.  
  586. //--------------------------------------------------------------------
  587. // Open
  588. //--------------------------------------------------------------------
  589.  
  590. SOM_Scope ODID  SOMLINK NoPartOpen(Apple_NoPart *somSelf, Environment *ev,
  591.         ODFrame* frame)
  592. {
  593.     /*    Open just calls ShowUserMessage (q.v.) which will first attempt
  594.         to rebind if this makes sense.
  595.         In the special case where this is the root part, Open will put
  596.         up an appropriate alert and always return false.
  597.         If rebinding fails, I throw kODErrAlreadyNotified to inform the
  598.         caller that the Open failed but that I've already alerted the
  599.         user.
  600.         In the case of the root part, the error will prevent the document
  601.         from opening. If it was the first/only document, the process
  602.         quits. Yay! */
  603.         
  604.     Apple_NoPartData *somThis = Apple_NoPartGetData(somSelf);
  605.     Apple_NoPartMethodDebug("Apple_NoPart","Open");
  606.     
  607.     SOM_TRY
  608.     
  609.     if( ! somSelf->ShowUserMessage(ev,kODTrue) )
  610.         THROW(kODErrAlreadyNotified);
  611.     
  612.     SOM_CATCH_ALL
  613.     SOM_ENDTRY
  614.     return 0;
  615. }
  616.  
  617.  
  618. //--------------------------------------------------------------------
  619. // HandleEvent
  620. //--------------------------------------------------------------------
  621.  
  622. SOM_Scope ODBoolean  SOMLINK NoPartHandleEvent(Apple_NoPart *somSelf, Environment *ev,
  623.         ODEventData* event,
  624.         ODFrame* frame,
  625.         ODFacet* facet,
  626.         ODEventInfo* eventInfo)
  627. {
  628.     Apple_NoPartData *somThis = Apple_NoPartGetData(somSelf);
  629.     Apple_NoPartMethodDebug("Apple_NoPart","HandleEvent");
  630.     
  631.     ODBoolean    tWasHandled = kODFalse;
  632.  
  633.     SOM_TRY
  634.  
  635.     switch (event->what)
  636.     {
  637.         case nullEvent:
  638.             break;
  639.         
  640.         case mouseDown:
  641.             if ( somSelf->CheckDoubleClick(ev, event) )
  642.             {
  643.                 _fIsDoubleClick = kODTrue;
  644.             }
  645.             else
  646.             {
  647.                 Rect rButton, rText;
  648.                 somSelf->ComputeButtonLocation(ev, frame, &rButton, &rText);
  649.                 if( PtInIconSuite(eventInfo->where.AsQDPoint(),&rButton,atTopLeft,gButtonIcon) ) {
  650.                     // Track click in button:
  651.                     if( somSelf->TrackButton(ev,facet,&rButton) )
  652.                         (void) somSelf->ShowUserMessage(ev,kODTrue);
  653.                 } else {
  654.                     // Otherwise pass click to container to select this frame:
  655.                     TempODFrame containingFrame = frame->AcquireContainingFrame(ev);
  656.                     if (containingFrame)
  657.                     {
  658.                         event->what = kODEvtMouseDownEmbedded;
  659.                         eventInfo->embeddedFrame = frame;
  660.                         eventInfo->embeddedFacet = facet;
  661.                         TempODPart part = containingFrame->AcquirePart(ev);
  662.                         tWasHandled = part->
  663.                             HandleEvent(ev,event,containingFrame,facet->GetContainingFacet(ev),eventInfo);
  664.                     }
  665.                 }
  666.             }
  667.             break;
  668.  
  669.         case mouseUp:
  670.  
  671.             tWasHandled = kODTrue;
  672.             somSelf->CaptureMouseUpEvent(ev, event, frame);
  673.             if (_fIsDoubleClick)
  674.             {
  675.                 somSelf->Open(ev, frame);
  676.                 tWasHandled = kODTrue;
  677.                 _fIsDoubleClick = kODFalse;
  678.             }
  679.             break;
  680.  
  681.         default:
  682.             return kODFalse;
  683.     }
  684.     
  685.     SOM_CATCH_ALL
  686.         tWasHandled = kODFalse;
  687.     SOM_ENDTRY
  688.     
  689.     return tWasHandled;
  690. }
  691.  
  692.  
  693. //--------------------------------------------------------------------
  694. // TrackButton
  695. //--------------------------------------------------------------------
  696.  
  697. SOM_Scope ODBoolean  SOMLINK NoPartTrackButton(Apple_NoPart *somSelf, Environment *ev,
  698.         ODFacet *facet,
  699.         Rect *button)
  700. {
  701.     Apple_NoPartData *somThis = Apple_NoPartGetData(somSelf);
  702.     Apple_NoPartMethodDebug("Apple_NoPart","TrackButton");
  703.  
  704.     CFocus foc(ev,facet);
  705.  
  706.     ODBoolean inside = kODFalse;
  707.     do {
  708.         Point mouse;
  709.         GetMouse(&mouse);
  710.         ODBoolean nowinside = PtInIconSuite(mouse,button,atTopLeft,gButtonIcon);
  711.         if( nowinside != inside ) {
  712.             PlotIconSuite(button, atTopLeft, nowinside ?ttSelected:ttNone, gButtonIcon);
  713.             inside = nowinside;
  714.         }
  715.     } while( StillDown() );
  716.  
  717.     if( inside )
  718.         PlotIconSuite(button, atTopLeft, ttNone, gButtonIcon);
  719.     return inside;
  720. }
  721.  
  722.  
  723. static ODBoolean
  724. IsRootPartSU( Environment *ev, ODStorageUnit *su )
  725. {
  726.     TempODStorageUnit rootSU = ODAcquireRootPartSUOfDraft(ev,su->GetDraft(ev));
  727.     return su==rootSU;
  728. }
  729.  
  730.  
  731. static void
  732. GetDocumentName( Environment *ev, ODStorageUnit *su, Str63 name )
  733. {
  734.     TempODContainerIDStruct id( su->GetDraft(ev)->GetDocument(ev)->GetContainer(ev)->GetID(ev));
  735.     ASSERT(id->_length>=8 && id->_length<=sizeof(FSSpec), kODErrAssertionFailed);
  736.     CopyPascalString(name, ((FSSpec*)id->_buffer)->name);
  737. }
  738.  
  739.  
  740. //--------------------------------------------------------------------
  741. // Rebind
  742. //--------------------------------------------------------------------
  743.  
  744. SOM_Scope ODBoolean  SOMLINK NoPartRebind(Apple_NoPart *somSelf, Environment *ev )
  745. {
  746.     /*    Rebinding is tricky when called from the part itself.
  747.         The part _will_ be deleted whether or not the operation succeeded!
  748.         Do not use 'somSelf' or 'somThis' after calling this method. */
  749.         
  750.     Apple_NoPartData *somThis = Apple_NoPartGetData(somSelf);
  751.     Apple_NoPartMethodDebug("Apple_NoPart","Rebind");
  752.     
  753.     ODBoolean status = kODTrue;
  754.     
  755.     SOM_TRY
  756.     
  757.     if( ODGetDraft(ev, _fStorageUnit)->GetPermissions(ev) < kODDPSharedWrite )
  758.         THROW(kODErrInvalidPermissions);
  759.     // Unfortunately one can't swap editors in a read-only document because
  760.     // UseEditor externalizes the WindowState...
  761.     
  762.     TempODEditor theEditor = _fSession->GetBinding(ev)->
  763.                                   ChooseEditorForPart( ev, _fStorageUnit, kODNULL );
  764.     ODBoolean editorIsNoPart = ODISOStrEqual(theEditor, kODBlackBoxHandlerOfLastResort);
  765.                           
  766.     if( !editorIsNoPart )
  767.         _fPartWrapper->UseEditor(ev,theEditor);
  768.     else
  769.         status = kODFalse;
  770.  
  771.     SOM_CATCH_ALL
  772.         status = kODFalse;
  773.         SetErrorCode(kODNoError);        // don't propagate any exception
  774.     SOM_ENDTRY
  775.     return status;
  776. }
  777.  
  778.  
  779. static ODBoolean
  780. CanTranslate( Environment *ev, ODSession *session, ODPartWrapper *partWrapper )
  781. {
  782.     // This function was blatantly stolen from TransDlg.cpp
  783.     TRY{
  784.         ODNameSpaceManager* nsm = session->GetNameSpaceManager(ev);
  785.         ODStorageUnit* storageUnit = partWrapper->GetStorageUnit(ev);
  786.         
  787.         // Create the list of kinds and translations
  788.         TempODTypeList kindList = session->GetStorageSystem(ev)->CreateTypeList(ev, (ODTypeList*) kODNULL);
  789.         
  790.         ContentValueTypes(storageUnit, kindList);
  791.  
  792.         { TempODEditor tempEditor = GetCurrentEditorForPart(partWrapper);
  793.           GetAllKindsForEditor(nsm, kindList, tempEditor);
  794.         }
  795.  
  796.         TempODTypeList translateToList = session->GetStorageSystem(ev)->CreateTypeList(ev, (ODTypeList*) kODNULL);
  797.         
  798.         OrderedCollection translateFromList;
  799.         GetDestinationKindsList(kindList, translateToList, &translateFromList, session);
  800.         
  801.         return (translateToList->Count(ev) > 0);
  802.     }CATCH_ALL{
  803.         WARN("CanTranslate got err %ld",ErrorCode());
  804.     }ENDTRY
  805.     return kODFalse;
  806. }
  807.  
  808.  
  809. //--------------------------------------------------------------------
  810. // ShowUserMessage
  811. //--------------------------------------------------------------------
  812.  
  813. SOM_Scope ODBoolean SOMLINK NoPartShowUserMessage( Apple_NoPart *somSelf, Environment *ev,
  814.         ODBoolean allowRebind )
  815. {
  816.     /*    There are a couple of things going on here.
  817.         1. First try reloading the original editor. If we succeed, just return.
  818.         2. Display the alert explaining why the part couldn't be opened.
  819.             (If this is the root part, use a special alert that explains why the _document_
  820.              couldn't be opened.)
  821.     */
  822.     
  823.     Apple_NoPartData *somThis = Apple_NoPartGetData(somSelf);
  824.     Apple_NoPartMethodDebug("Apple_NoPart","ShowUserMessage");
  825.     
  826.     // Check whether this is the root part, and if not, attempt to rebind:
  827.     short id;
  828.     ODBoolean writeable = ODGetDraft(ev, _fStorageUnit)->GetPermissions(ev) >= kODDPSharedWrite;
  829.     Str63 docName = "\p";
  830.     if( IsRootPartSU(ev,_fStorageUnit) ) {
  831.         id = kNoPartRootDlogID;                // special alert for root part
  832.         GetDocumentName(ev,_fStorageUnit,docName);
  833.     } else {
  834.         // First try to rebind if doc is writeable:
  835.         id = kNoPartDlogID;
  836.         if( allowRebind && writeable ) {
  837.             ODPart *wrapper = _fPartWrapper;
  838.             if( somSelf->Rebind(ev) )
  839.                 return kODTrue;
  840.             else {
  841.                 /* We're in a precarious state now: Even though the rebind failed,
  842.                     the part has been deleted. To get around this, find the _new_
  843.                     part and tell it to show the message. */
  844.                 Apple_NoPart *part = CAST(wrapper->GetRealPart(ev),Apple_NoPart);
  845.                 wrapper->ReleaseRealPart(ev);
  846.                 part->ShowUserMessage(ev,kODFalse);
  847.                 return kODFalse;
  848.             }
  849.         }
  850.     }
  851.     
  852.     // Determine the text to be put into the alert:
  853.     ODIText msg = somSelf->ComputeUserMessage(ev);
  854.     Str255 message;
  855.     GetITextPString(&msg,message);
  856.     DisposeITextStruct(msg);
  857.     
  858.     Str31 errStr;
  859.     NumToString(_fUserMessageID,errStr);
  860.     
  861.     ODBoolean canTranslate;
  862.     Str255 translateStr;
  863.     if( _fUserMessageID==kFakeErrNoEditor || _fUserMessageID==kFakeErrNoEditorNoName ) {
  864.         canTranslate = writeable && CanTranslate(ev,_fSession,_fPartWrapper);
  865.         CUsingLibraryResources r;
  866.         GetIndString(translateStr,kNoPartTranslationStrID, 1+canTranslate);
  867.     } else {
  868.         canTranslate = kODFalse;
  869.         translateStr[0] = '\0';
  870.     }
  871.     
  872.     ParamText(message,docName,translateStr,errStr);
  873.  
  874.     // Show the alert (which is really a dialog so we can play with the Translate button):
  875.     short result = ok;
  876.     if ( _fUserMessageID != kODErrAlreadyNotified )        // should test earlier?
  877.     {
  878.         CUsingLibraryResources r;
  879.         DialogPtr dlog = ODGetNewDialog(ev,id,_fSession,kODFalse);
  880.         if( !dlog ) return kODFalse;
  881.         SetDialogDefaultItem(dlog,ok);
  882.  
  883.         if( _fUserMessageID==kFakeErrNoEditor || _fUserMessageID==kFakeErrNoEditorNoName ) {
  884.             HideDialogItem(dlog,kErrorNumberItem);
  885.             if( !canTranslate ) {
  886.                 short typ;
  887.                 ControlHandle but;
  888.                 Rect box;
  889.                 GetDialogItem(dlog,kTranslateItem,&typ,(Handle*)&but,&box);
  890.                 HiliteControl(but,kControlDisabledPart);
  891.             }
  892.         } else
  893.             HideDialogItem(dlog,kTranslateItem);
  894.         
  895.         SetPort(dlog);
  896.         ShowWindow(dlog);
  897.         SelectWindow(dlog);
  898.         TempODMenuBar menu = _fSession->GetWindowState(ev)->AcquireCurrentMenuBar(ev);
  899.         ODDialogBegin(ev,_fSession,menu,dlog);
  900.         ModalDialog(GetODDialogFilter(),&result);
  901.         DisposeDialog(dlog);
  902.         ODDialogEnd();
  903.     }
  904.  
  905.     // Run the translation dialog if the user pushed the "Translate..." button:
  906.     if( result==kTranslateItem ) {
  907.         TRY{
  908.             ODTranslation* translation = _fSession->GetTranslation(ev);
  909.             result= translation->ShowPartTranslateDialog(ev, _fPartWrapper);
  910.         }CATCH_ALL{
  911.             WARN("Translation returned err %ld",ErrorCode());
  912.             result = kODFalse;
  913.         }ENDTRY
  914.         return result;
  915.     }
  916.     
  917.     return kODFalse;
  918. }
  919.  
  920.  
  921.  
  922. //--------------------------------------------------------------------
  923. // CaptureMouseUpEvent
  924. //--------------------------------------------------------------------
  925.  
  926. SOM_Scope ODBoolean  SOMLINK NoPartCaptureMouseUpEvent(Apple_NoPart *somSelf, Environment *ev,
  927.         ODEventData* event,
  928.         ODFrame* frame)
  929. {
  930.     Apple_NoPartData *somThis = Apple_NoPartGetData(somSelf);
  931.     Apple_NoPartMethodDebug("Apple_NoPart","NoPartCaptureMouseUpEvent");
  932.  
  933.     ODBoolean returnVal = kODTrue;  
  934.  
  935.         // do this for double-click monitoring
  936.     _fMouseWhen  = event->when;
  937.     _fMouseWhere = event->where;
  938.     
  939.     return (returnVal);
  940. }
  941.  
  942.  
  943. //--------------------------------------------------------------------
  944. // CheckDoubleClick
  945. //--------------------------------------------------------------------
  946.  
  947. SOM_Scope ODBoolean  SOMLINK NoPartCheckDoubleClick(Apple_NoPart *somSelf, Environment *ev,
  948.         ODEventData* event)
  949. {
  950.     Apple_NoPartData *somThis = Apple_NoPartGetData(somSelf);
  951.     Apple_NoPartMethodDebug("Apple_NoPart","NoPartCheckDoubleClick");
  952.  
  953.     ODBoolean    isDoubleClick;
  954.     Rect        testRect;
  955.     
  956.     isDoubleClick = (event->when - _fMouseWhen) <= GetDblTime();
  957.     
  958.     SetRect(&testRect, _fMouseWhere.IntX( ), _fMouseWhere.IntY( ), 
  959.                         _fMouseWhere.IntX( ), _fMouseWhere.IntY( ));
  960.     InsetRect(&testRect, -2, -2);
  961.     
  962.     isDoubleClick &= PtInRect(event->where, &testRect);
  963.  
  964.     return isDoubleClick;
  965. }
  966.  
  967.  
  968. //--------------------------------------------------------------------
  969. // Stub methods
  970. //--------------------------------------------------------------------
  971.  
  972.  
  973. #pragma mark -------stubs-------
  974.  
  975.  
  976. SOM_Scope void  SOMLINK NoPartContainingPartPropertiesUpdated(Apple_NoPart *somSelf, Environment *ev,
  977.         ODFrame* frame,
  978.         ODStorageUnit* propertyUnit)
  979. {
  980. //  Apple_NoPartData *somThis = Apple_NoPartGetData(somSelf);
  981.     Apple_NoPartMethodDebug("Apple_NoPart","ContainingPartPropertiesUpdated");
  982.  
  983. }
  984.  
  985. SOM_Scope void  SOMLINK NoPartDisplayFrameAdded(Apple_NoPart *somSelf, Environment *ev,
  986.         ODFrame* frame)
  987. {
  988. //  Apple_NoPartData *somThis = Apple_NoPartGetData(somSelf);
  989.     Apple_NoPartMethodDebug("Apple_NoPart","DisplayFrameAdded");
  990. }
  991.  
  992. SOM_Scope void  SOMLINK NoPartDisplayFrameRemoved(Apple_NoPart *somSelf, Environment *ev,
  993.         ODFrame* frame)
  994. {
  995. //  Apple_NoPartData *somThis = Apple_NoPartGetData(somSelf);
  996.     Apple_NoPartMethodDebug("Apple_NoPart","DisplayFrameRemoved");
  997.  
  998. }
  999.  
  1000. SOM_Scope void  SOMLINK NoPartDisplayFrameConnected(Apple_NoPart *somSelf, Environment *ev,
  1001.         ODFrame* frame)
  1002. {
  1003. //  Apple_NoPartData *somThis = Apple_NoPartGetData(somSelf);
  1004.     Apple_NoPartMethodDebug("Apple_NoPart","DisplayFrameConnected");
  1005. }
  1006.  
  1007. SOM_Scope void  SOMLINK NoPartDisplayFrameClosed(Apple_NoPart *somSelf, Environment *ev,
  1008.         ODFrame* frame)
  1009. {
  1010. //  Apple_NoPartData *somThis = Apple_NoPartGetData(somSelf);
  1011.     Apple_NoPartMethodDebug("Apple_NoPart","DisplayFrameClosed");
  1012. }
  1013.  
  1014. SOM_Scope void  SOMLINK NoPartAttachSourceFrame(Apple_NoPart *somSelf, Environment *ev,
  1015.         ODFrame* frame,
  1016.         ODFrame* sourceFrame)
  1017. {
  1018. //  Apple_NoPartData *somThis = Apple_NoPartGetData(somSelf);
  1019.     Apple_NoPartMethodDebug("Apple_NoPart","AttachSourceFrame");
  1020. }
  1021.  
  1022. SOM_Scope void  SOMLINK NoPartFrameShapeChanged(Apple_NoPart *somSelf, Environment *ev,
  1023.         ODFrame* frame)
  1024. {
  1025. //  Apple_NoPartData *somThis = Apple_NoPartGetData(somSelf);
  1026.     Apple_NoPartMethodDebug("Apple_NoPart","FrameShapeChanged");
  1027. }
  1028.  
  1029. SOM_Scope void  SOMLINK NoPartViewTypeChanged(Apple_NoPart *somSelf, Environment *ev,
  1030.         ODFrame* frame)
  1031. {
  1032. //  Apple_NoPartData *somThis = Apple_NoPartGetData(somSelf);
  1033.     Apple_NoPartMethodDebug("Apple_NoPart","ViewTypeChanged");
  1034. }
  1035.  
  1036. SOM_Scope void  SOMLINK NoPartPresentationChanged(Apple_NoPart *somSelf, Environment *ev,
  1037.         ODFrame* frame)
  1038. {
  1039. //  Apple_NoPartData *somThis = Apple_NoPartGetData(somSelf);
  1040.     Apple_NoPartMethodDebug("Apple_NoPart","PresentationChanged");
  1041. }
  1042.  
  1043. SOM_Scope void  SOMLINK NoPartSequenceChanged(Apple_NoPart *somSelf, Environment *ev,
  1044.         ODFrame* frame)
  1045. {
  1046. //  Apple_NoPartData *somThis = Apple_NoPartGetData(somSelf);
  1047.     Apple_NoPartMethodDebug("Apple_NoPart","SequenceChanged");
  1048. }
  1049.  
  1050. SOM_Scope ODInfoType  SOMLINK NoPartReadPartInfo(Apple_NoPart *somSelf, Environment *ev,
  1051.         ODFrame* frame,
  1052.         ODStorageUnitView* storageUnitView)
  1053. {
  1054. //  Apple_NoPartData *somThis = Apple_NoPartGetData(somSelf);
  1055.     Apple_NoPartMethodDebug("Apple_NoPart","ReadPartInfo");
  1056.  
  1057.     return kODNULL;
  1058. }
  1059.  
  1060. SOM_Scope void  SOMLINK NoPartWritePartInfo(Apple_NoPart *somSelf, Environment *ev,
  1061.         ODInfoType partInfo,
  1062.         ODStorageUnitView* storageUnitView)
  1063. {
  1064. //  Apple_NoPartData *somThis = Apple_NoPartGetData(somSelf);
  1065.     Apple_NoPartMethodDebug("Apple_NoPart","WritePartInfo");
  1066.  
  1067. }
  1068.  
  1069. SOM_Scope void  SOMLINK NoPartClonePartInfo(Apple_NoPart *somSelf, Environment *ev,
  1070.         ODDraftKey key,
  1071.         ODInfoType partInfo,
  1072.         ODStorageUnitView* storageUnitView,
  1073.         ODFrame* scopeFrame)
  1074. {
  1075. //  Apple_NoPartData *somThis = Apple_NoPartGetData(somSelf);
  1076.     Apple_NoPartMethodDebug("Apple_NoPart","ClonePartInfo");
  1077.  
  1078. }
  1079.  
  1080. SOM_Scope void  SOMLINK NoPartFacetAdded(Apple_NoPart *somSelf, Environment *ev,
  1081.         ODFacet* facet)
  1082. {
  1083. //  Apple_NoPartData *somThis = Apple_NoPartGetData(somSelf);
  1084. }
  1085.  
  1086. SOM_Scope void  SOMLINK NoPartFacetRemoved(Apple_NoPart *somSelf, Environment *ev,
  1087.         ODFacet* facet)
  1088. {
  1089. //  Apple_NoPartData *somThis = Apple_NoPartGetData(somSelf);
  1090.     Apple_NoPartMethodDebug("Apple_NoPart","FacetRemoved");
  1091. }
  1092.  
  1093. SOM_Scope void  SOMLINK NoPartCanvasChanged(Apple_NoPart *somSelf, Environment *ev,
  1094.         ODFacet* facet)
  1095. {
  1096. //  Apple_NoPartData *somThis = Apple_NoPartGetData(somSelf);
  1097.     Apple_NoPartMethodDebug("Apple_NoPart","CanvasChanged");
  1098. }
  1099.  
  1100. SOM_Scope void  SOMLINK NoPartGeometryChanged(Apple_NoPart *somSelf, Environment *ev,
  1101.         ODFacet* facet,
  1102.         ODBoolean clipShapeChanged,
  1103.         ODBoolean externalTransformChanged)
  1104. {
  1105. //  Apple_NoPartData *somThis = Apple_NoPartGetData(somSelf);
  1106.     Apple_NoPartMethodDebug("Apple_NoPart","GeometryChanged");
  1107. }
  1108.  
  1109. SOM_Scope void  SOMLINK NoPartCanvasUpdated(Apple_NoPart *somSelf, Environment *ev,
  1110.         ODCanvas* canvas)
  1111. {
  1112. //  Apple_NoPartData *somThis = Apple_NoPartGetData(somSelf);
  1113.     Apple_NoPartMethodDebug("Apple_NoPart","CanvasUpdated");
  1114. }
  1115.  
  1116. SOM_Scope void  SOMLINK NoPartHighlightChanged(Apple_NoPart *somSelf, Environment *ev,
  1117.         ODFacet* facet)
  1118. {
  1119. //  Apple_NoPartData *somThis = Apple_NoPartGetData(somSelf);
  1120.     Apple_NoPartMethodDebug("Apple_NoPart","HighlightChanged");
  1121. }
  1122.  
  1123. SOM_Scope ODULong  SOMLINK NoPartGetPrintResolution(Apple_NoPart *somSelf, Environment *ev,
  1124.         ODFrame* frame)
  1125. {
  1126. //  Apple_NoPartData *somThis = Apple_NoPartGetData(somSelf);
  1127.     Apple_NoPartMethodDebug("Apple_NoPart","GetPrintResolution");
  1128.  
  1129.     return 0;
  1130. }
  1131.  
  1132. SOM_Scope void  SOMLINK NoPartLinkStatusChanged(Apple_NoPart *somSelf, Environment *ev,
  1133.         ODFrame* frame)
  1134. {
  1135. //  Apple_NoPartData *somThis = Apple_NoPartGetData(somSelf);
  1136.     Apple_NoPartMethodDebug("Apple_NoPart","LinkStatusChanged");
  1137. }
  1138.  
  1139. SOM_Scope ODBoolean  SOMLINK NoPartBeginRelinquishFocus(Apple_NoPart *somSelf, Environment *ev,
  1140.         ODTypeToken focus,
  1141.         ODFrame* ownerFrame,
  1142.         ODFrame* proposedFrame)
  1143. {
  1144. //  Apple_NoPartData *somThis = Apple_NoPartGetData(somSelf);
  1145.     Apple_NoPartMethodDebug("Apple_NoPart","BeginRelinquishFocus");
  1146.  
  1147.     return kODFalse;
  1148. }
  1149.  
  1150. SOM_Scope void  SOMLINK NoPartCommitRelinquishFocus(Apple_NoPart *somSelf, Environment *ev,
  1151.         ODTypeToken focus,
  1152.         ODFrame* ownerFrame,
  1153.         ODFrame* proposedFrame)
  1154. {
  1155. //  Apple_NoPartData *somThis = Apple_NoPartGetData(somSelf);
  1156.     Apple_NoPartMethodDebug("Apple_NoPart","CommitRelinquishFocus");
  1157. }
  1158.  
  1159. SOM_Scope void  SOMLINK NoPartAbortRelinquishFocus(Apple_NoPart *somSelf, Environment *ev,
  1160.         ODTypeToken focus,
  1161.         ODFrame* ownerFrame,
  1162.         ODFrame* proposedFrame)
  1163. {
  1164. //  Apple_NoPartData *somThis = Apple_NoPartGetData(somSelf);
  1165.     Apple_NoPartMethodDebug("Apple_NoPart","AbortRelinquishFocus");
  1166. }
  1167.  
  1168. SOM_Scope void  SOMLINK NoPartFocusAcquired(Apple_NoPart *somSelf, Environment *ev,
  1169.         ODTypeToken focus,
  1170.         ODFrame* ownerFrame)
  1171. {
  1172. //  Apple_NoPartData *somThis = Apple_NoPartGetData(somSelf);
  1173.     Apple_NoPartMethodDebug("Apple_NoPart","FocusAcquired");
  1174. }
  1175.  
  1176. SOM_Scope void  SOMLINK NoPartFocusLost(Apple_NoPart *somSelf, Environment *ev,
  1177.         ODTypeToken focus,
  1178.         ODFrame* ownerFrame)
  1179. {
  1180. //  Apple_NoPartData *somThis = Apple_NoPartGetData(somSelf);
  1181.     Apple_NoPartMethodDebug("Apple_NoPart","FocusLost");
  1182. }
  1183.  
  1184.  
  1185. SOM_Scope void  SOMLINK NoPartExternalizeKinds(Apple_NoPart *somSelf, Environment *ev,
  1186.         ODTypeList* kindset)
  1187. {
  1188. //  Apple_NoPartData *somThis = Apple_NoPartGetData(somSelf);
  1189.     Apple_NoPartMethodDebug("Apple_NoPart","ExternalizeKinds");
  1190. }
  1191.  
  1192. SOM_Scope void  SOMLINK NoPartChangeKind(Apple_NoPart *somSelf, Environment *ev,
  1193.         ODType kind)
  1194. {
  1195. //  Apple_NoPartData *somThis = Apple_NoPartGetData(somSelf);
  1196.     Apple_NoPartMethodDebug("Apple_NoPart","ChangeKind");
  1197. }
  1198.  
  1199. SOM_Scope void  SOMLINK NoPartAdjustMenus(Apple_NoPart *somSelf, Environment *ev,
  1200.         ODFrame* frame)
  1201. {
  1202. //  Apple_NoPartData *somThis = Apple_NoPartGetData(somSelf);
  1203.     Apple_NoPartMethodDebug("Apple_NoPart","AdjustMenus");
  1204. }
  1205.